﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Diagnostics;

namespace TrenchcoatRobots.Classes.ComponentClasses.Colliders {
	class BoxCollider : Collider {
		public Vector2 Size { get; set; }
		public Vector2 Offset { get; set; }

		#region Constructors
		/// <summary>
		/// Creates a new BoxCollider
		/// </summary>
		/// <param name="parent">The GameObject of which the BoxCollider will be placed on</param>
		/// <param name="offset">How the BoxCollider should be offset from the GameObject point of origin</param>
		/// <param name="size">The dimensions of the BoxCollider</param>
		public BoxCollider (ParentMethod parentMethod, Vector2 offset, Vector2 size)
			: base(parentMethod, "BoxCollider") {
			Size = size;
			Offset = Offset;
		}
		#endregion

		public int LeftEdge() {
			return (int)Math.Round( Parent().Position.X + Offset.X - ( Size.X * 0.5 ) );
		}
		public int RightEdge() {
			return (int)Math.Round( Parent().Position.X + Offset.X + ( Size.X * 0.5 ) );
		}
		public int TopEdge() {
			return (int)Math.Round( Parent().Position.Y + Offset.Y - ( Size.Y * 0.5 ) );
		}
		public int BottomEdge() {
			return (int)Math.Round( Parent().Position.Y + Offset.Y + ( Size.Y * 0.5 ) );
		}
	}
}
